<!DOCTYPE html PUBLIC "-//W3C//DTD//XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <title>CSSOM - StyleSheet - Instance</title>
    <link rel="author" title="Glenn Adams" href="mailto:glenn@skynav.com"/>
    <link rel="help" href="http://www.w3.org/TR/cssom/#the-stylesheet-interface"/>
    <meta name="flags" content="dom"/>
    <script src="/resources/testharness.js"/>
    <script src="/resources/testharnessreport.js"/>
    <style id="sheet"/>
  </head>
  <body>
    <div id="log"></div>
    <div id="box"></div>
    <script><![CDATA[

      var doc = window.document;

      test(function(){

        assert_true('styleSheets' in doc);

      }, '\'styleSheets\' in doc');

      var sheets = doc.styleSheets;

      test(function(){

        assert_true(sheets.length > 0);

      }, 'doc.styleSheets.length > 0');

      var sheet = doc.styleSheets[0];

      test(function(){

        assert_true(!(sheet instanceof Function));

      }, '! doc.styleSheets[0] instanceof Function');

      test(function(){

        assert_true('type' in sheet);

      }, '\'type\' in doc.styleSheets[0]');

      test(function(){

        assert_equals(typeof(sheet.type),'string');

      }, 'typeof(doc.styleSheets[0].type) === \'string\'');

      test(function(){

        assert_true('href' in sheet);

      }, '\'href\' in doc.styleSheets[0]');

      test(function(){

        assert_true(sheet.href === null || typeof(sheet.href) == 'string');

      }, 'doc.styleSheets[0].href is null or typeof(doc.styleSheets[0].href) == \'string\'');

      test(function(){

        assert_true('ownerNode' in sheet);

      }, '\'ownerNode\' in doc.styleSheets[0]');

      test(function(){

        assert_true(sheet.ownerNode instanceof Node);

      }, 'doc.styleSheets[0].ownerNode instanceof Node');

      test(function(){

        assert_true('parentStyleSheet' in sheet);

      }, '\'parentStyleSheet\' in doc.styleSheets[0]');

      test(function(){

        assert_true(sheet.parentStyleSheet === null || sheet.parentStyleSheet instanceof StyleSheet);

      }, 'doc.styleSheets[0].parentStyleSheet is null or instanceof StyleSheet');

      test(function(){

        assert_true('title' in sheet);

      }, '\'title\' in doc.styleSheets[0]');

      test(function(){

        assert_true(sheet.title === null || typeof(sheet.title) == 'string');

      }, 'doc.styleSheets[0].title is null or typeof(doc.styleSheets[0].title) == \'string\'');

      test(function(){

        assert_true('media' in sheet);

      }, '\'media\' in doc.styleSheets[0]');

      test(function(){

        assert_true(sheet.media instanceof MediaList);

      }, 'doc.styleSheets[0].media instanceof MediaList');

      test(function(){

        assert_true('disabled' in sheet);

      }, '\'disabled\' in doc.styleSheets[0]');

      test(function(){

        assert_equals(typeof(sheet.disabled),'boolean');

      }, 'typeof(doc.styleSheets[0].disabled) == \'boolean\'');

    ]]>
    </script>
  </body>
</html>
